home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
prog
/
pbc23c.arj
/
EXTRACT.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-03-13
|
1KB
|
30 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
SUB Extract (St$, Delimiter$, Index%, Start%, SLen%)
Ind% = Index%
IF LEN(Delimiter$) > 0 AND Index% > 0 THEN
Start% = 1
DO
tmp% = INSTR(Start%, St$, Delimiter$)
Ind% = Ind% - 1
IF Ind% = 0 THEN
IF tmp% THEN
SLen% = tmp% - Start%
ELSE
SLen% = LEN(St$) - Start% + 1
END IF
ELSEIF tmp% = 0 THEN
SLen% = 0
ELSE
Start% = tmp% + LEN(Delimiter$)
END IF
LOOP UNTIL tmp% = 0 OR Ind% = 0
ELSE
SLen% = -1
END IF
END SUB